package com.mianyang.zhangsan.common.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import java.util.List;

@Configuration
public class MVCConfiguration extends WebMvcConfigurationSupport {
    @Autowired
    private MappingJackson2HttpMessageConverter converter;

    @Override
    protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
        converters.add(converter);
        super.addDefaultHttpMessageConverters(converters);
    }
}
